//停车记录 - 静态 路由
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

export type GridTable = {
  success: boolean;
  data?: {
    //今日在场
    today_in_park: number;
    //区间在场
    section_in_park: Array<any>;
    //当前在场
    now_in_park: number;
    //今日流水
    today_flowing_water: number;
    //区间流水
    section_flowing_water: Array<any>;
    //今日活跃车场
    today_park: number;
  };
  message?: "";
};

export type LineTable = {
  success: boolean;
  data?: {
    all: Array<any>;
    parknfly: Array<any>;
    rztc: Array<any>;
    xq: Array<any>;
    dingtalk: Array<any>;
  };
  message?: "";
};

type Result = {
  success: boolean;
  data?: Array<any>;
  message?: string;
};

const basePath = "statistics/";

//四方格
export const Grid = () => {
  return http.request<GridTable>("post", baseUrlApi(basePath + "grid"), {});
};

//折线图
export const Line = () => {
  return http.request<LineTable>("post", baseUrlApi(basePath + "line"), {});
};

//问题反馈
export const Question = () => {
  return http.request<Result>("post", baseUrlApi(basePath + "question"), {});
};
